//
//  WaveTableViewCell.m
//  MyYiJianKangApp
//
//  Created by 张国文 on 16/5/5.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//

#import "WaveTableViewCell.h"

@interface WaveTableViewCell ()

@property (nonatomic, strong) UILabel *jianCeJiXiangLabel; // 检测几项
@property (nonatomic, strong) UILabel *jianKangZhiShuLabel; // 健康指数



@end

@implementation WaveTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addMySubview];
    }
    return self;
}

// 布局
- (void)addMySubview
{
    // 以前的布局
  //  [self firstBujv];
   
}

- (void)setModel:(ZGWJianKangDangAnMessageModel *)model
{
    [self nowFirstSubviewWith:model];
}

// 现在第一种布局
- (void)nowFirstSubviewWith:(ZGWJianKangDangAnMessageModel *)model
{
    // 一共检测了几项
    self.jianCeJiXiangLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 35 * kAdjustParamater, kScreenWidth, 20 * kAdjustParamater)];
 //   self.jianCeJiXiangLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    self.jianCeJiXiangLabel.text = [NSString stringWithFormat:@"您一共检测了%@项", model.detect_count];
    self.jianCeJiXiangLabel.textAlignment = NSTextAlignmentCenter;
    self.jianCeJiXiangLabel.textColor = [UIColor blackColor];
    self.jianCeJiXiangLabel.font = [UIFont systemFontOfSize:k20Big];
    [self.contentView addSubview:_jianCeJiXiangLabel];
    
    // 建议健康指数标题
    UILabel *jianKangZhiShuTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.jianCeJiXiangLabel.bottom + 35 * kAdjustParamater, kScreenWidth, 20 * kAdjustParamater)];
   // jianKangZhiShuTitleLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    jianKangZhiShuTitleLabel.text = @"基因健康指数";
    jianKangZhiShuTitleLabel.textColor = [UIColor blackColor];
    jianKangZhiShuTitleLabel.textAlignment = NSTextAlignmentCenter;
    jianKangZhiShuTitleLabel.font = [UIFont systemFontOfSize:k20Big];
    [self.contentView addSubview:jianKangZhiShuTitleLabel];
    
//    // 风险纠正后指数
//    UILabel *fengXianJiuZhengZhiTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(210 * kAdjustParamater, jianKangZhiShuTitleLabel.top, 160 * kAdjustParamater, 20 * kAdjustParamater)];
//    fengXianJiuZhengZhiTitleLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
//    fengXianJiuZhengZhiTitleLabel.text = @"风险纠正后指数";
//    fengXianJiuZhengZhiTitleLabel.textAlignment = NSTextAlignmentLeft;
//    fengXianJiuZhengZhiTitleLabel.textColor = [UIColor blackColor];
//    fengXianJiuZhengZhiTitleLabel.font = [UIFont systemFontOfSize:k17Big];
//    [self.contentView addSubview:fengXianJiuZhengZhiTitleLabel];
    
    // 健康指数的大小
    float jianKangZhiCount = [model.health_score floatValue] * 10;
    // 记录健康指数的布局数组，1代表黄色，2代表半彩色，3代表灰色
    NSMutableArray *jianKangZhiShuArray = [NSMutableArray array];
    if (jianKangZhiCount > 0.0 && jianKangZhiCount <= 1.0) {
        [jianKangZhiShuArray addObject:@"2"];
        [jianKangZhiShuArray addObject:@"3"];
        [jianKangZhiShuArray addObject:@"3"];
         [jianKangZhiShuArray addObject:@"3"];
         [jianKangZhiShuArray addObject:@"3"];
    } else if (jianKangZhiCount > 1.0 && jianKangZhiCount <= 2.0) {
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"3"];
        [jianKangZhiShuArray addObject:@"3"];
        [jianKangZhiShuArray addObject:@"3"];
        [jianKangZhiShuArray addObject:@"3"];
    } else if (jianKangZhiCount > 2.0 && jianKangZhiCount <= 3.0) {
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"2"];
        [jianKangZhiShuArray addObject:@"3"];
        [jianKangZhiShuArray addObject:@"3"];
        [jianKangZhiShuArray addObject:@"3"];
    } else if (jianKangZhiCount > 3.0 && jianKangZhiCount <= 4.0) {
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"3"];
        [jianKangZhiShuArray addObject:@"3"];
        [jianKangZhiShuArray addObject:@"3"];
    } else if (jianKangZhiCount > 4.0 && jianKangZhiCount <= 5.0) {
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"2"];
        [jianKangZhiShuArray addObject:@"3"];
        [jianKangZhiShuArray addObject:@"3"];
    } else if (jianKangZhiCount > 5.0 && jianKangZhiCount <= 6.0) {
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"3"];
        [jianKangZhiShuArray addObject:@"3"];
    } else if (jianKangZhiCount > 6.0 && jianKangZhiCount <= 7.0) {
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"2"];
        [jianKangZhiShuArray addObject:@"3"];
    } else if (jianKangZhiCount > 7.0 && jianKangZhiCount <= 8.0) {
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"3"];
    } else if (jianKangZhiCount > 8.0 && jianKangZhiCount <= 9.0) {
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"2"];
    } else if (jianKangZhiCount > 9.0 && jianKangZhiCount <= 10.0) {
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"1"];
        [jianKangZhiShuArray addObject:@"1"];
    }
    // 进行基因健康指数五角星的动态布局
    for (int i = 0; i < jianKangZhiShuArray.count; i++) {
        NSString *count = jianKangZhiShuArray[i];
        UIImageView *wuJiaoXingImageV = [[UIImageView alloc] initWithFrame:CGRectMake(123 * kAdjustParamater + (14 + 3) * i * kAdjustParamater, jianKangZhiShuTitleLabel.bottom + 30 * kAdjustParamater, 14 * kAdjustParamater, 14 * kAdjustParamater)];
        if ([count isEqualToString:@"1"]) {
            // 彩色
            wuJiaoXingImageV.image = [UIImage imageNamed:@"hangseWuJiaoXing-shilibaogao"];
        } else if ([count isEqualToString:@"2"]) {
            // 半彩色
            wuJiaoXingImageV.image = [UIImage imageNamed:@"bancaisewujiaoxing-shilibaogao"];
        } else if ([count isEqualToString:@"3"]) {
            // 灰色
            wuJiaoXingImageV.image = [UIImage imageNamed:@"huisewujiaoxing-shilibaogao"];
        }
        [self.contentView addSubview:wuJiaoXingImageV];
    }
    
    // 健康指数数值
    UILabel *jianKangZhiShuCountLabel = [[UILabel alloc] initWithFrame:CGRectMake(216 * kAdjustParamater, jianKangZhiShuTitleLabel.bottom + 27 * kAdjustParamater, 100 * kAdjustParamater, 20 * kAdjustParamater)];
 //   jianKangZhiShuCountLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    jianKangZhiShuCountLabel.text = [NSString stringWithFormat:@"%.1f", jianKangZhiCount];
    jianKangZhiShuCountLabel.textColor = [UIColor blackColor];
    jianKangZhiShuCountLabel.textAlignment = NSTextAlignmentLeft;
    jianKangZhiShuCountLabel.font = [UIFont systemFontOfSize:k18Big];
    [self.contentView addSubview:jianKangZhiShuCountLabel];
    
    // 波浪视图
    // 百分号
    NSString *baiFenHao = @"%";
    self.waveView = [[TYWaveProgressView alloc] initWithFrame:CGRectMake((375 - 156) / 2 * kAdjustParamater,  jianKangZhiShuCountLabel.bottom + 30 * kAdjustParamater, 156 * kAdjustParamater, 180 * kAdjustParamater) withFirstColor:[UIColor colorWithRed:38 / 255.0 green:97 / 255.0 blue:161 / 255.0 alpha:0.8] AndSecondColor:[UIColor colorWithRed:38 / 255.0 green:97 / 255.0 blue:161 / 255.0 alpha:0.8]];
    self.waveView.userInteractionEnabled = YES;
    self.waveView.waveViewMargin = UIEdgeInsetsMake(15 * kAdjustParamater, 8 * kAdjustParamater, 8 * kAdjustParamater, 10 * kAdjustParamater);
    self.waveView.backgroundImageView.image = [UIImage imageNamed:@"进度框烧杯3-01"];
    self.waveView.numberLabel.text = [NSString stringWithFormat:@"%.0f%@", [model.proportion floatValue] * 100, baiFenHao];
    //  self.waveView.numberLabel.font = [UIFont systemFontOfSize:45 * kAdjustParamater];
    self.waveView.numberLabel.font = [UIFont fontWithName:@"Helvetica-Oblique" size:50 * kAdjustParamater];
    
    
    
    
    self.waveView.numberLabel.textColor = [UIColor colorWithRed:166 / 255.0 green:208 / 255.0 blue:107 / 255.0 alpha:1];
    
    self.waveView.percent = [model.proportion floatValue];
    [self.contentView addSubview:_waveView];
    [self.waveView startWave];
    
    // 纠正前烧杯上方的透明的视图
    self.shaoBeiOnJiuZhengQianView = [[UILabel alloc] initWithFrame:CGRectMake(self.waveView.left, self.waveView.top, 156 * kAdjustParamater, 180 * kAdjustParamater)];
    self.shaoBeiOnJiuZhengQianView.userInteractionEnabled = YES;
    self.shaoBeiOnJiuZhengQianView.backgroundColor = [UIColor clearColor];
    [self.contentView addSubview:_shaoBeiOnJiuZhengQianView];
    
    
    // 纠正前打败的用户
    self.jiuZhengQianDaBaiYongHuLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.waveView.bottom + 30 * kAdjustParamater, kScreenWidth, 20 * kAdjustParamater)];
    float jiuZhengQianBaiFeiBi = [model.proportion floatValue] * 100;
    
    self.jiuZhengQianDaBaiYongHuLabel.text = [NSString stringWithFormat:@"打败了%.0f%@的用户", jiuZhengQianBaiFeiBi, baiFenHao];
    self.jiuZhengQianDaBaiYongHuLabel.textColor = [UIColor blackColor];
    self.jiuZhengQianDaBaiYongHuLabel.textAlignment = NSTextAlignmentCenter;
    self.jiuZhengQianDaBaiYongHuLabel.font = [UIFont systemFontOfSize:k18Big];
    self.jiuZhengQianDaBaiYongHuLabel.userInteractionEnabled = YES;
    [self.contentView addSubview:_jiuZhengQianDaBaiYongHuLabel];
    
    // 矫正以后健康指数title
    
    UILabel *jianKangZhiShuJiuZhengHouTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.jiuZhengQianDaBaiYongHuLabel.bottom + 40 * kAdjustParamater, kScreenWidth, 20 * kAdjustParamater)];
    // jianKangZhiShuTitleLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    jianKangZhiShuJiuZhengHouTitleLabel.text = @"风险矫正后健康指数";
    jianKangZhiShuJiuZhengHouTitleLabel.textColor = [UIColor blackColor];
    jianKangZhiShuJiuZhengHouTitleLabel.textAlignment = NSTextAlignmentCenter;
    jianKangZhiShuJiuZhengHouTitleLabel.font = [UIFont systemFontOfSize:k20Big];
    [self.contentView addSubview:jianKangZhiShuJiuZhengHouTitleLabel];
    
    // 风险纠正后指数的大小
    float fengXianJiuZhengHouCount = [model.health_score_modifed floatValue] * 10;
    // 记录风险纠正后监看该指数的布局数组，1代表黄色，2代表办彩色，3代表灰色
    NSMutableArray *fengXianJiuZhengHouArray = [NSMutableArray array];
    if (fengXianJiuZhengHouCount > 0.0 && fengXianJiuZhengHouCount <= 1.0) {
        [fengXianJiuZhengHouArray addObject:@"2"];
        [fengXianJiuZhengHouArray addObject:@"3"];
        [fengXianJiuZhengHouArray addObject:@"3"];
        [fengXianJiuZhengHouArray addObject:@"3"];
        [fengXianJiuZhengHouArray addObject:@"3"];
    } else if (fengXianJiuZhengHouCount > 1.0 && fengXianJiuZhengHouCount <= 2.0) {
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"3"];
        [fengXianJiuZhengHouArray addObject:@"3"];
        [fengXianJiuZhengHouArray addObject:@"3"];
        [fengXianJiuZhengHouArray addObject:@"3"];
    } else if (fengXianJiuZhengHouCount > 2.0 && fengXianJiuZhengHouCount <= 3.0) {
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"2"];
        [fengXianJiuZhengHouArray addObject:@"3"];
        [fengXianJiuZhengHouArray addObject:@"3"];
        [fengXianJiuZhengHouArray addObject:@"3"];
    } else if (fengXianJiuZhengHouCount > 3.0 && fengXianJiuZhengHouCount <= 4.0) {
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"3"];
        [fengXianJiuZhengHouArray addObject:@"3"];
        [fengXianJiuZhengHouArray addObject:@"3"];
    } else if (fengXianJiuZhengHouCount > 4.0 && fengXianJiuZhengHouCount <= 5.0) {
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"2"];
        [fengXianJiuZhengHouArray addObject:@"3"];
        [fengXianJiuZhengHouArray addObject:@"3"];
    } else if (fengXianJiuZhengHouCount > 5.0 && fengXianJiuZhengHouCount <= 6.0) {
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"3"];
        [fengXianJiuZhengHouArray addObject:@"3"];
    } else if (fengXianJiuZhengHouCount > 6.0 && fengXianJiuZhengHouCount <= 7.0) {
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"2"];
        [fengXianJiuZhengHouArray addObject:@"3"];
    } else if (fengXianJiuZhengHouCount > 7.0 && fengXianJiuZhengHouCount <= 8.0) {
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"3"];
    } else if (fengXianJiuZhengHouCount > 8.0 && fengXianJiuZhengHouCount <= 9.0) {
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"2"];
    } else if (fengXianJiuZhengHouCount > 9.0 && fengXianJiuZhengHouCount <= 10.0) {
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"1"];
        [fengXianJiuZhengHouArray addObject:@"1"];
    }
   // NSLog(@"矫正前的健康指数:%f, 矫正后的健康指数:%f", jianKangZhiCount, fengXianJiuZhengHouCount);
    
    // 进行纠正后健康指数五角星的动态布局
    // 进行基因健康指数五角星的动态布局
    for (int i = 0; i < fengXianJiuZhengHouArray.count; i++) {
        NSString *count = fengXianJiuZhengHouArray[i];
        UIImageView *wuJiaoXingImageV = [[UIImageView alloc] initWithFrame:CGRectMake(123 * kAdjustParamater + (14 + 3) * i * kAdjustParamater, jianKangZhiShuJiuZhengHouTitleLabel.bottom + 30 * kAdjustParamater, 14 * kAdjustParamater, 14 * kAdjustParamater)];
        if ([count isEqualToString:@"1"]) {
            // 彩色
            wuJiaoXingImageV.image = [UIImage imageNamed:@"hangseWuJiaoXing-shilibaogao"];
        } else if ([count isEqualToString:@"2"]) {
            // 半彩色
            wuJiaoXingImageV.image = [UIImage imageNamed:@"bancaisewujiaoxing-shilibaogao"];
        } else if ([count isEqualToString:@"3"]) {
            // 灰色
            wuJiaoXingImageV.image = [UIImage imageNamed:@"huisewujiaoxing-shilibaogao"];
        }
        [self.contentView addSubview:wuJiaoXingImageV];
    }

    // 风险纠正后数值label
    UILabel *jianKangZhiShuJiuZhengHouCountLabel = [[UILabel alloc] initWithFrame:CGRectMake(216 * kAdjustParamater, jianKangZhiShuJiuZhengHouTitleLabel.bottom + 27 * kAdjustParamater, 100 * kAdjustParamater, 20 * kAdjustParamater)];
    //   jianKangZhiShuCountLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    jianKangZhiShuJiuZhengHouCountLabel.text = [NSString stringWithFormat:@"%.1f", fengXianJiuZhengHouCount];
    jianKangZhiShuJiuZhengHouCountLabel.textColor = [UIColor blackColor];
    jianKangZhiShuJiuZhengHouCountLabel.textAlignment = NSTextAlignmentLeft;
    jianKangZhiShuJiuZhengHouCountLabel.font = [UIFont systemFontOfSize:k18Big];
    [self.contentView addSubview:jianKangZhiShuJiuZhengHouCountLabel];
    
    // 风险纠正后健康指数波浪视图
    
    self.jiuZhengHouWaveView = [[TYWaveProgressView alloc] initWithFrame:CGRectMake((375 - 156) / 2 * kAdjustParamater,  jianKangZhiShuJiuZhengHouCountLabel.bottom + 30 * kAdjustParamater, 156 * kAdjustParamater, 180 * kAdjustParamater) withFirstColor:[UIColor colorWithRed:166 / 255.0 green:208 / 255.0 blue:107 / 255.0 alpha:1] AndSecondColor:[UIColor colorWithRed:166 / 255.0 green:208 / 255.0 blue:107 / 255.0 alpha:1]];
    self.jiuZhengHouWaveView.userInteractionEnabled = YES;
    self.jiuZhengHouWaveView.waveViewMargin = UIEdgeInsetsMake(15 * kAdjustParamater, 8 * kAdjustParamater, 8 * kAdjustParamater, 10 * kAdjustParamater);
    self.jiuZhengHouWaveView.backgroundImageView.image = [UIImage imageNamed:@"进度框烧杯3-01"];
    self.jiuZhengHouWaveView.numberLabel.text = [NSString stringWithFormat:@"%.0f%@", [model.proportion_modifed floatValue] * 100, baiFenHao];
    //  self.waveView.numberLabel.font = [UIFont systemFontOfSize:45 * kAdjustParamater];
    self.jiuZhengHouWaveView.numberLabel.font = [UIFont fontWithName:@"Helvetica-Oblique" size:50 * kAdjustParamater];
    
    
    self.jiuZhengHouWaveView.numberLabel.textColor = [UIColor colorWithRed:38 / 255.0 green:97 / 255.0 blue:161 / 255.0 alpha:0.8];
    
    self.jiuZhengHouWaveView.percent = [model.proportion_modifed floatValue];
    [self.contentView addSubview:_jiuZhengHouWaveView];
    [self.jiuZhengHouWaveView startWave];
    
    // 纠正后烧杯上方的透明视图
    self.shaoBeiOnJiuZhengHouView = [[UILabel alloc] initWithFrame:CGRectMake(self.jiuZhengHouWaveView.left, self.jiuZhengHouWaveView.top, 156 * kAdjustParamater, 180 * kAdjustParamater)];
    self.shaoBeiOnJiuZhengHouView.userInteractionEnabled = YES;
    self.shaoBeiOnJiuZhengHouView.backgroundColor = [UIColor clearColor];
    [self.contentView addSubview:_shaoBeiOnJiuZhengHouView];
    
    // 风险纠正后打败了多少用户
    self.jiuZhengHouDaBaiYongHuLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.jiuZhengHouWaveView.bottom + 30 * kAdjustParamater, kScreenWidth, 20 * kAdjustParamater)];
    self.jiuZhengHouDaBaiYongHuLabel .text =  [NSString stringWithFormat:@"打败了%.0f%@的用户", [model.proportion_modifed floatValue] * 100, baiFenHao];
    self.jiuZhengHouDaBaiYongHuLabel .textColor = [UIColor blackColor];
    self.jiuZhengHouDaBaiYongHuLabel .textAlignment = NSTextAlignmentCenter;
    self.jiuZhengHouDaBaiYongHuLabel .font = [UIFont systemFontOfSize:k18Big];
    self.jiuZhengHouDaBaiYongHuLabel.userInteractionEnabled = YES;
    [self.contentView addSubview:_jiuZhengHouDaBaiYongHuLabel];
  
    // 底部灰色条
    self.grayLineOnBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, self.jiuZhengHouDaBaiYongHuLabel .bottom + 35 * kAdjustParamater, kScreenWidth, 1 * kAdjustParamater)];
    self.grayLineOnBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.07];
    [self.contentView addSubview:_grayLineOnBottom];
    
}

// 以前的布局
- (void)firstBujv
{
    // 波浪视图
    
    self.waveView = [[TYWaveProgressView alloc] initWithFrame:CGRectMake((375 - 156) / 2 * kAdjustParamater, 33 * kAdjustParamater, 156 * kAdjustParamater, 180 * kAdjustParamater) withFirstColor:[UIColor cyanColor] AndSecondColor:[UIColor cyanColor]];
    self.waveView.waveViewMargin = UIEdgeInsetsMake(15 * kAdjustParamater, 8 * kAdjustParamater, 8 * kAdjustParamater, 10 * kAdjustParamater);
    self.waveView.backgroundImageView.image = [UIImage imageNamed:@"进度框烧杯3-01"];
    self.waveView.numberLabel.text = @"66%";
    //  self.waveView.numberLabel.font = [UIFont systemFontOfSize:45 * kAdjustParamater];
    self.waveView.numberLabel.font = [UIFont fontWithName:@"Helvetica-Oblique" size:50 * kAdjustParamater];
    
    
    self.waveView.numberLabel.textColor = [UIColor colorWithRed:166 / 255.0 green:208 / 255.0 blue:107 / 255.0 alpha:1];
    
    self.waveView.percent = 0.6;
    [self.contentView addSubview:_waveView];
    [self.waveView startWave];
    // 检测几项
    UILabel *jianCeJiXiangLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.waveView.bottom + 25* kAdjustParamater, kScreenWidth, 15 * kAdjustParamater)];
    //     jianCeJiXiangLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    jianCeJiXiangLabel.text = @"您一共检测了10项";
    jianCeJiXiangLabel.textColor = [UIColor blackColor];
    jianCeJiXiangLabel.textAlignment = NSTextAlignmentCenter;
    jianCeJiXiangLabel.font = [UIFont systemFontOfSize:k16Big];
    [self.contentView addSubview:jianCeJiXiangLabel];
    
    //    // 健康指数
    UILabel *jianKangZhiShuLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, jianCeJiXiangLabel.bottom + 13 * kAdjustParamater, kScreenWidth, 15 * kAdjustParamater)];
    //   jianKangZhiShuLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    jianKangZhiShuLabel.text = @"您的健康指数高于66%用户";
    jianKangZhiShuLabel.textColor = [UIColor blackColor];
    jianKangZhiShuLabel.textAlignment = NSTextAlignmentCenter;
    jianKangZhiShuLabel.font = [UIFont systemFontOfSize:k16Big];
    [self.contentView addSubview:jianKangZhiShuLabel];
    
    // 底部灰色条
    UILabel *grayLineOnBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, (330 - 1) * kAdjustParamater, kScreenWidth, 1 * kAdjustParamater)];
    grayLineOnBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.07];
    [self.contentView addSubview:grayLineOnBottom];

}


@end
